package com.weiyuwqj.app.mobile.article;

import com.alibaba.druid.filter.AutoLoad;
import com.weiyuwqj.api.common.Paginator;
import com.weiyuwqj.api.service.SysArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by zhangyong on 2017/5/5.
 */
@Controller
@RequestMapping(value = "/mobile/article")
public class MobileArticleController {

    @Autowired
    private SysArticleService articleService;

    /**
     * 公告列表
     * @param p
     * @return
     */
    @ResponseBody
    @RequestMapping("/articleList")
    public Object articleList(Paginator p){
        Map map=new HashMap();
        return articleService.getList(p,map);
    }

    /**
     * 查询单条公告
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/getArticleById")
    public Object getArticleById(Integer id){
        return articleService.selectByKey(id);
    }
}
